package com.neusoft.weixin.service.person;


import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neusoft.weixin.repository.person.PersonDao;


@Service(value = "personService")
public class PersonService {

	@Autowired
	private PersonDao personDao;
	
	public Map getPersonInfo(String cardId) {
		List<Map<String,String>> personList = personDao.getPersonInfo(cardId);
		if ( personList.size() > 0 ){
			return personList.get(0);
		}else{
			return null;
		}
	}
	
	public Map getPersonInfoByOpenId(String openId) {
		List<Map<String,String>> personList = personDao.getPersonInfoByOpenId(openId);
		if ( personList.size() > 0 ){
			return personList.get(0);
		}else{
			return null;
		}
	}
	
	public void insertUserInfo(Map map){
		personDao.insertUserInfo(map);
	}

}
